﻿using Mapster;
using SqlSugar;
using Zhp.Entity.Monitor;
using Zhp.IService.Monitor;
using Zhp.Model.Monitor;
using Zhp.Service.Base;
using Zhp.SqlSugar.Repository;

namespace Zhp.Service.Monitor
{
    public class ExceptionLogService : BaseService<ExceptionLog>, IExceptionLogService
    {
        public ExceptionLogService(IBaseRepository<ExceptionLog> rep)
        {
            _rep = rep;
        }

        public async Task<List<ExceptionLogModel>> Query(ExceptionLogSearch search)
        {
            var list = await _rep.GetPageListAsync(new List<IConditionalModel>
            {
            }, search, x => x.CreateTime, OrderByType.Desc);

            return list.Adapt<List<ExceptionLogModel>>();
        }
    }
}
